<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs-popup.jsp" %>
<%@ taglib prefix="g" uri="http://geni-max.com/tags" %>
<script type="text/javascript" src="${ctx}/js/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="${ctx}/struts/js/jquery/jquery-plugins.js"></script>
<script type="text/javascript" src="${ctx}/struts/geni/js/Tree.js"></script>
<script type="text/javascript" src="${ctx}/struts/geni/js/TreeToolBar.js"></script>
<script type="text/javascript" src="${ctx}/struts/geni/js/TreeUtil.js"></script>

<style>
  .col1 {
    width: 10%;
  }
  .col2 {
    width: 40%;
  }
  .col3 {
    width: 50%;
  }
 
</style>
<script>
</script>
<g:panel>
	<div class="currentPosition">
		<g:property value="%{getText('current.position')}"></g:property>
		<g:property value="%{getText('assign.menu.resource')}"></g:property>
	</div>
</g:panel>
<g:panel>
	<g:actionmessage></g:actionmessage>
	<g:actionerror></g:actionerror>
	<g:form namespace="/account" action="assignMenuAndResource2Role" validate="true" method="post">
		<g:hidden name="id" value="%{id}" />
		<g:grid cols="3"  colCssClassList="{'col1', 'col2', 'col3'}">
	        <g:label key="role.name" name="entity.name" inputcolspan="2"/>
	        <g:newline/>
	         <tr>
	        	<td style="vertical-align:top;text-align:right;padding-right:2px;">
	        		<g:property value="%{getText('role.assign.menu')}"/>:
	        	</td>
	        	<td colspan="2" id="menuTree">
		 			<div>
				        <g:tree tree="menuTreeRoot" name="menuTree"
				        	isShowIcon="true"
				        	isShowCheckbox="true" 
					 		getChildrenNamespace="/menu" 
					 		getChildrenAction="GetMenuTreeChildren"
					 		checkedNodeKeys="%{menuTree}"
			 			/>
		 			</div>
		 		</td>
		 	</tr>
		 	
		 	<tr>
	        	<td style="vertical-align:top;text-align:right;padding-right:2px;">
	        		<g:property value="%{getText('role.assign.resource')}"/>:
	        	</td>
	        	<td colspan="2" id="resourceTree">
		 			<div>
				        <g:tree tree="resourceTreeRoot" name="resourceTree"
				        	isShowIcon="true"
				        	isShowCheckbox="true" 
					 		getChildrenNamespace="/account" 
					 		getChildrenAction="GetResourceTreeChildren"
					 		checkedNodeKeys="%{resourceTree}"
			 			/>
		 			</div>
		 		</td>
		 	</tr>
	      	<g:fieldgroup name="group" inputcolspan="2">
				<g:submit align="center" key="button.submit"/>
				<g:reset align="center" key="button.reset"/>
			</g:fieldgroup>
		</g:grid>
	</g:form>
</g:panel>